package org.mm.xml.entities;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;

/**
 * TherapyTaskXML
 *
 * @author Marco Traversari
 * @version $Revision: $ $Date: $ $Author: $
 */
@XmlType (propOrder={"name", "description", "startDate", "endDate", "cronExpression", "drug", "sensor", "therapyTaskEvents"})
public class TherapyTaskXML extends EntityXML {

	private Date startDate = null;

	private Date endDate = null;

	private String cronExpression = null;

	private DrugXML drug = null;

	private SensorXML sensor = null;

	private List<TherapyTaskEventXML> therapyTaskEvents = null;


	public TherapyTaskXML() {
	}

/*	public TherapyTaskXML(Long id) {
		this.id = id;
	}*/

	/**
	 * getStartDate
	 * @return startDate
	 */
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * setStartDate
	 * @param startDate
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * getEndDate
	 * @return endDate
	 */
	public Date getEndDate() {
		return endDate;
	}

	/**
	 * setEndDate
	 * @param endDate
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * getCronExpression
	 * @return cronExpression
	 */
	public String getCronExpression() {
		return cronExpression;
	}

	/**
	 * setCronExpression
	 * @param cronExpression
	 */
	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	/**
	 * getDrug
	 * @return drug
	 */
	public DrugXML getDrug() {
		return drug;
	}

	/**
	 * setDrug
	 * @param drug
	 */
	public void setDrug(DrugXML drug) {
		this.drug = drug;
	}

	/**
	 * getSensor
	 * @return sensor
	 */
	public SensorXML getSensor() {
		return sensor;
	}

	/**
	 * setSensor
	 * @param sensor
	 */
	public void setSensor(SensorXML sensor) {
		this.sensor = sensor;
	}

	/**
	 * getTherapyTaskEvents
	 * @return therapyTaskEvents
	 */
	@XmlElementWrapper(name = "therapyTaskEvents")
	@XmlElement(name = "therapyTaskEvent")
	public List<TherapyTaskEventXML> getTherapyTaskEvents() {
		return therapyTaskEvents;
	}

	/**
	 * setTherapyTaskEvents
	 * @param therapyTaskEvents
	 */
	public void setTherapyTaskEvents(List<TherapyTaskEventXML> therapyTaskEvents) {
		this.therapyTaskEvents = therapyTaskEvents;
	}

	/**
	 * addTherapyTaskEvent
	 * @param therapyTaskEvent
	 */
	public void addTherapyTaskEvent(TherapyTaskEventXML therapyTaskEvent) {
		if (therapyTaskEvents == null) {
			therapyTaskEvents = new ArrayList<TherapyTaskEventXML>();
		}
		therapyTaskEvents.add(therapyTaskEvent);
	}
}
